package cloudgamesaumysql

import (
	"gorm.io/gorm"
	"time"
)

/*
  @author liubogeng
  @date   2024/8/27 11:08
*/

// CGGameAUUserTimeStatistics 云游戏AU用户时长表；可用时长 = （累计时长-消耗时长-冻结时长）；使用毫秒为单位； 【后续可以改名为cg_game_all_user_time_statistics】
type CGGameAUUserTimeStatistics struct {
	ID                           int64          `json:"id" gorm:"column:id;type:bigint;primaryKey;autoIncrement;comment:ID"`
	UserID                       int64          `json:"user_id" gorm:"column:user_id;type:bigint;not null;default:0;comment:用户ID"`
	TotalDuration                int64          `json:"total_duration" gorm:"column:total_duration;type:bigint;not null;default:0;comment:累计时长"`
	AvailableDuration            int64          `json:"available_duration" gorm:"column:available_duration;type:bigint;not null;default:0;comment:可用时长"`
	ConsumedDuration             int64          `json:"consumed_duration" gorm:"column:consumed_duration;type:bigint;not null;default:0;comment:累计消耗时长"`
	FrozenDuration               int64          `json:"frozen_duration" gorm:"column:frozen_duration;type:bigint;not null;default:0;comment:冻结可用时长"`
	UserLoginFreeTime            int64          `json:"user_login_free_time" gorm:"column:user_login_free_time;type:bigint;not null;default:0;comment:用户的登录免费时长"`
	ConsumedUserLoginFreeTime    int64          `json:"consumed_user_login_free_time" gorm:"column:consumed_user_login_free_time;type:bigint;not null;default:0;comment:消耗用户的登录免费时长"`
	FrozenUserLoginFreeTime      int64          `json:"frozen_user_login_free_time" gorm:"column:frozen_user_login_free_time;type:bigint;not null;default:0;comment:冻结用户的登录免费时长"`
	UserRechargeFreeTime         int64          `json:"user_recharge_free_time" gorm:"column:user_recharge_free_time;type:bigint;not null;default:0;comment:用户的充值免费时长"`
	ConsumedUserRechargeFreeTime int64          `json:"consumed_user_recharge_free_time" gorm:"column:consumed_user_recharge_free_time;type:bigint;not null;default:0;comment:消耗用户的充值免费时长"`
	FrozenUserRechargeFreeTime   int64          `json:"frozen_user_recharge_free_time" gorm:"column:frozen_user_recharge_free_time;type:bigint;not null;default:0;comment:冻结用户的充值免费时长"`
	CreatedAt                    time.Time      `json:"created_at" gorm:"column:created_at;type:datetime;comment:该条记录创建时间"`
	UpdatedAt                    time.Time      `json:"updated_at" gorm:"column:updated_at;type:datetime;comment:该条记录修改时间"`
	DeletedAt                    gorm.DeletedAt `json:"-" gorm:"index;type:datetime;comment:该条记录删除时间"`
}

func (CGGameAUUserTimeStatistics) TableName() string {
	return "cg_game_au_user_time_statistics"
}
